/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package queenb.web.store;

import java.sql.Date;
import java.sql.SQLException;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import oracle.jdbc.OracleTypes;
import queenb.net.datacontrol.DataStatement;
import queenb.net.datacontrol.Param;
import queenb.net.entitybean.V150;
import queenb.web.util.PackageContants;

/**
 *
 * @author VANANH
 */
public class V150Store extends V150 {

    public List<V150> vcurpks_listoftabv150(int pnFV050, String pvLOGIN) throws SQLException, InstantiationException, IllegalAccessException {
        DataStatement dataStatement = new DataStatement(PackageContants.vcurpks_listoftabv150, OracleTypes.CURSOR, new Param[]{
                    new Param(OracleTypes.INTEGER, pnFV050),
                    new Param(OracleTypes.CHAR, pvLOGIN)
                });

        return super.find(dataStatement, V150.class);
    }

//    public List<SelectItem> getCitySelect(String pnV150, int pn750) throws SQLException, InstantiationException, IllegalAccessException {
//        List<V150> listV150 = getListCity(pnV150, pn750);
//        List<SelectItem> listSelect = new ArrayList<SelectItem>();
//        for (int i = 0; i < listV150.size(); i++) {
//            V150 a000 = listV150.get(i);
//            listSelect.add(new SelectItem(a000.getPa000(), a000.getAv001()));
//        }
//
//        return listSelect;
//    }
    public int stdv_tools_inserttabv150(int pnPV150, String pvVV151, String pvVV152, String pvVV153, String pvVV154, Date pdVD155, int pnVN156, int pnVN157, Date pdVD158, int pnVN159, int pnVN160, String pvVV161, String pvVV162, String pvVV163, String pvVV164, Date pdVD165, int pnVN166, int pnVN167, Date pdVD168, int pnVN169, int pnVN170, int pnFV050, int pnFK100F, int pnFK100T, String pvLOGIN) {
        try {
            DataStatement updateStatement = new DataStatement(PackageContants.stdv_tools_inserttabv150, OracleTypes.INTEGER, new Param[]{
                        new Param(OracleTypes.INTEGER, pnPV150),
                        new Param(OracleTypes.CHAR, pvVV151),
                        new Param(OracleTypes.CHAR, pvVV152),
                        new Param(OracleTypes.CHAR, pvVV153),
                        new Param(OracleTypes.CHAR, pvVV154),
                        new Param(OracleTypes.DATE, pdVD155),
                        new Param(OracleTypes.INTEGER, pnVN156),
                        new Param(OracleTypes.INTEGER, pnVN157),
                        new Param(OracleTypes.DATE, pdVD158),
                        new Param(OracleTypes.INTEGER, pnVN159),
                        new Param(OracleTypes.INTEGER, pnVN160),
                        new Param(OracleTypes.CHAR, pvVV161),
                        new Param(OracleTypes.CHAR, pvVV162),
                        new Param(OracleTypes.CHAR, pvVV163),
                        new Param(OracleTypes.CHAR, pvVV164),
                        new Param(OracleTypes.DATE, pdVD165),
                        new Param(OracleTypes.INTEGER, pnVN166),
                        new Param(OracleTypes.INTEGER, pnVN167),
                        new Param(OracleTypes.DATE, pdVD168),
                        new Param(OracleTypes.INTEGER, pnVN169),
                        new Param(OracleTypes.INTEGER, pnVN170),
                        new Param(OracleTypes.INTEGER, pnFV050),
                        new Param(OracleTypes.INTEGER, pnFK100F),
                        new Param(OracleTypes.INTEGER, pnFK100T),
                        new Param(OracleTypes.CHAR, pvLOGIN)});
            return super.update(updateStatement, V150.class);
        } catch (SQLException ex) {

            return 0;
        }

    }

    public int stdv_tools_stornotabv150(int pnPV150, String pvLOGIN) {
        try {
            DataStatement dataStatement = new DataStatement(PackageContants.stdv_tools_stornotabv150, OracleTypes.INTEGER, new Param[]{
                        new Param(OracleTypes.INTEGER, pnPV150),
                        new Param(OracleTypes.CHAR, pvLOGIN)
                    });
            return super.update(dataStatement, V150.class);
        } catch (SQLException ex) {
            Logger.getLogger(V150Store.class.getName()).log(Level.SEVERE, null, ex);
            return 0;
        }

    }
}
